package com.gao.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Projectname springboot-06-security
 * @Filename RoutlerController
 * @Author an
 * @Data 2022/8/14 9:30
 * @Description TODO
 */
@Controller
public class RoutlerController {

    @GetMapping({"/","/index"})
    public String index(){
        return "index";
    }

    @GetMapping("/tologin")
    public String toLogin(){
        return "views/login";
    }

    @GetMapping("/level1/{id}")
    public String level1(@PathVariable("id")Integer id){
        return "views/level1/"+id;
    }

    @GetMapping("/level2/{id}")
    public String level2(@PathVariable("id")Integer id){
        return "views/level2/"+id;
    }

    @GetMapping("/level3/{id}")
    public String level3(@PathVariable("id")Integer id){
        return "views/level3/"+id;
    }
}
